//
//  HOTMemoInputViewController.m
//  Genpara
//
//  Created by AndyChang.zhang on 14-9-22.
//  Copyright (c) 2014年 zhangchh. All rights reserved.
//

#import "HOTMemoInputViewController.h"

@interface HOTMemoInputViewController ()

@end

@implementation HOTMemoInputViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self setNaviTitle:@"メモ入力"];
    
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg_memo"]];
    
    [self addRightBtnTarget:self action:@selector(saveBtnClicked) image:[UIImage imageNamed:@"btn_save_off"] hImage:[UIImage imageNamed:@"btn_save_on"]];
    
    //bgImageView.image = [bgImageView.image stretchableImageWithLeftCapWidth:5 topCapHeight:5];
    bgImageView.image = [bgImageView.image resizableImageWithCapInsets:UIEdgeInsetsMake(20, 20, 20, 20)];
    
    _contentTextView.text = self.orgContent;
}

-(void)saveBtnClicked {
    
    if (self.setNewMemoContentBlock) {
        self.setNewMemoContentBlock(_contentTextView.text);
    }
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
